program a;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  mass1, mass2: array of integer;
  mass: array of array of integer;
  fin: textFile;
  x, y, x1, y1, n, m, i, s1, s2: integer;
begin
  assignFile(fin,'input.txt');
  reset(fin);
  readln(fin,n);
  setlength(mass, n, 2);
  for i:=0 to n-1 do
  begin
    read(fin, mass[i,1]);
    read(fin, mass[i,2]);
    readln(fin);
  end;
  readln(fin,m);
  setlength(mass1,m);
  setlength(mass2,m);
  for i:=0 to m-1 do
  begin
    read(fin, mass1[i]);
    read(fin, mass2[i]);
    readln(fin);
  end;
  for i:=0 to m-1 do
  begin
    x1:=x1+mass1[i];
    y1:=y1+mass2[i];
  end;
  x:=x1 div n;
  y:=y1 div m;
  for i:=1 to m-2 do
  begin
    s1:=s1+mass1[0]*mass2[i]-mass1[i]*mass1[0]+mass1[i]*mass2[i+1];
    s1:=s1-mass1[i+1]*mass2[i]+mass1[i+1]*mass2[0]-mass1[0]*mass2[i+1];
  end;
  for i:=0 to m-2 do
  begin
    s2:=s2+x*mass2[i]-mass1[i]*y+mass1[i]*mass2[i+1]-mass1[i+1]*mass2[i];
    s2:=s2+mass1[i+1]*y-x*mass2[i+1];
  end;
  s2:=s2+x*mass2[m-1]-mass1[m-1]*y+mass1[m-1]*mass2[0]-mass1[0]*mass2[m-1];
  s2:=s2+mass1[0]*y-x*mass2[0];
  if (abs(s1)>=abs(s2)) then
    writeln('in')
  else
    writeln('out');
  readln;
end.
 